import 'package:json_annotation/json_annotation.dart';
part 'public_httpResult.g.dart';

@JsonSerializable(genericArgumentFactories: true)
class HttpResult {
  String? targetUrl;
  bool success;
  HttpErrorResult? error;
  bool? unAuthorizedRequest;
  dynamic result;

  HttpResult(this.targetUrl, this.success, this.error, this.unAuthorizedRequest, this.result);

  factory HttpResult.fromJson(Map<String, dynamic> json) => _$HttpResultFromJson(json);
  Map<String, dynamic> toJson() => _$HttpResultToJson(this);
}

@JsonSerializable()
class HttpErrorResult {
  int? code;
  String? details;
  String? message;
  String? validationErrors;

  HttpErrorResult(this.code, this.details, this.message, this.validationErrors);
  factory HttpErrorResult.fromJson(Map<String, dynamic> json) => _$HttpErrorResultFromJson(json);
  Map<String, dynamic> toJson() => _$HttpErrorResultToJson(this);
}